package com.cheer.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cheer.dto.StandingBookReviewLogDTO;
import com.cheer.entity.ReferenceReviewLogEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 参评日志审核表
 * 
 * @author chufangzheng
 * @email 1280251739@qq.com
 * @date 2022-02-20 11:41:00
 */
@Mapper
public interface ReferenceReviewLogDao extends BaseMapper<ReferenceReviewLogEntity> {

    List<StandingBookReviewLogDTO> listByAccountId(@Param("applicantId") Long applicantId,
                                                   @Param("type") Integer type,
                                                   @Param("referenceId") Long referenceId);


    default List<ReferenceReviewLogEntity> selectNoPassAndReferenceIds(List<Long> referenceIds){

        QueryWrapper<ReferenceReviewLogEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().in(ReferenceReviewLogEntity::getReferenceId, referenceIds).eq(ReferenceReviewLogEntity::getAction, "不通过");

        return selectList(queryWrapper);
    }



}
